package Opration;

import Book.BookList;

import java.util.Scanner;

public class FindOperation implements IOperation{
    @Override
    public void work(BookList bookList) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("查找图书");
        System.out.println("请输入要查找的图书：");
        String name = scanner.nextLine();
        for (int i = 0; i < bookList.getUseSized(); i++) {
           if(bookList.books[i].getName().equals(name)){
               System.out.println("找到了");
               System.out.println(bookList.books[i]);
               return;
           }
        }
        System.out.println("找不到你要的书");
    }
}
